package com.weds.data_sync.util.xxl_component;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;

@Data
@ConfigurationProperties("xxl.rest")
public class XxlProperties {

    @Value("${xxl.job.admin.addresses:http://127.0.0.1:8087/xxl-job-admin}")
    private String adminAddresses;

    @Value("${xxl.job.accessToken:default_token}")
    private String accessToken;

    @Value("${xxl.job.executor.appname:data-sync-executor}")
    private String appname;

    @Value("${xxl.job.executor.address}")
    private String address;

    @Value("${xxl.job.executor.ip}")
    private String ip;

    @Value("${xxl.job.executor.port:9998}")
    private int port;

    @Value("${xxl.job.executor.logpath:./xxl_job/applogs/jobhandler}")
    private String logPath;

    @Value("${xxl.job.executor.logretentiondays:30}")
    private int logRetentionDays;

    private final String TOKEN_KEY = "job_token";

    @Value("${xxl.common-job.token:weds_default_token}")
    private String token;

    @Value("${xxl.common-job.secret:abcde12345!@#$%,}")
    private String secret;

    // 定义接口
    /**
     * 执行器列表
     */
    private String queryExecutorListApi = "/weds/executor/v1/pageList";
    private String addExecutorApi = "/weds/executor/v1/add";
    private String updateExecutorApi = "/weds/executor/v1/update";
    private String removeExecutorApi = "/weds/executor/v1/remove";
    private String queryItemExecutorApi = "/weds/executor/v1/loadById";

    private String queryTaskListApi = "/weds/task/v1/pageList";
    private String addTaskApi = "/weds/task/v1/add";
    private String updateTaskApi = "/weds/task/v1/update";
    private String removeTaskApi = "/weds/task/v1/remove";
    private String stopTaskApi = "/weds/task/v1/stop";
    private String startTaskApi = "/weds/task/v1/start";
    private String triggerTaskApi = "/weds/task/v1/trigger";
    private String nextTriggerTimeTaskApi = "/weds/task/v1/nextTriggerTime";


}
